package com.hr.reactive.flux;

import com.hr.reactive.common.Utils;
import reactor.core.publisher.Flux;

import java.time.Duration;

/**
 * 间隔
 */
public class Lec04FluxInterval {
    public static void main(String[] args) {
        Flux.interval(Duration.ofMillis(500)).
                map(i->Utils.faker().name().firstName()).
                subscribe(Utils.subscriber());
        Utils.sleepSeconds(5000);
    }
}
